﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LiveCS.Forms;
using System.Windows.Forms;

namespace LiveCS.Core
{
    /// <summary>
    /// 单例模式，非弹出窗口，一般是嵌入的 UserControl
    /// </summary>
    public class GlobalObject
    {
        #region 变量

        private static GlobalObject _instance = null;
        private static readonly object _padlock = new Object();

        #endregion

        #region 属性

        public static GlobalObject Instance
        {
            get
            {
                lock (_padlock)
                {
                    if (_instance == null)
                    {
                        _instance = new GlobalObject();
                    }
                    return _instance;
                }
            }
        }

        private frmMemberList _memberList;
        /// <summary>
        /// 会员列表界面
        /// </summary>
        public frmMemberList MemberListForm
        {
            get
            {
                if (null == _memberList)
                {
                    _memberList = new frmMemberList();
                    _memberList.Dock = DockStyle.Fill;
                }
                return _memberList;
            }
        }

        private frmWaitList _waitList;
        /// <summary>
        /// 等待人员列表界面
        /// </summary>
        public frmWaitList WaitListForm
        {
            get
            {
                if (null == _waitList)
                {
                    _waitList = new frmWaitList();
                    _waitList.Dock = DockStyle.Fill;
                }
                return _waitList;
            }
        }

        private frmFightList _fightList;
        /// <summary>
        /// 战队人员列表界面
        /// </summary>
        public frmFightList FightListForm
        {
            get
            {
                if (null == _fightList)
                {
                    _fightList = new frmFightList();
                    _fightList.Dock = DockStyle.Fill;
                }
                return _fightList;
            }
        }

        private frmExitList _exitList;
        /// <summary>
        /// 退出人员列表界面
        /// </summary>
        public frmExitList ExitListForm
        {
            get
            {
                if (null == _exitList)
                {
                    _exitList = new frmExitList();
                    _exitList.Dock = DockStyle.Fill;
                }
                return _exitList;
            }
        }

        #endregion
    }
}
